#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
int a[] = { 6,2,5,5,4,5,6,3,7,6 };

int f(int x) {
	if (x == 0) return 6;
	int sum = 0;
	while (x) {
		sum += a[x % 10];
		x /= 10;
	}
	return sum;
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n; cin >> n;
	int ans = 0;
	for (int i = 0; i <= 1111; i++) {
		for (int j = 0; j <= 1111; j++) {
			if (f(i) + f(j) + f(i + j) + 4 == n) {
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}